<?php
/*
********9、PHP操作MySQL********
*/

//连接数据库
function connect(){
    $serve = 'localhost:3306';
    $username = 'root';
    $password = '';
    $dbname = 'news_2';
    $link = mysqli_connect(
        $serve,$username,$password,
        $dbname);
        // 设置数据库字符集
    mysqli_set_charset($link,'UTF8'); 
    return $link;
}
//关闭数据库连接
function close($link){
	
    mysqli_close($link);
}



?>